//
//  YWLittleVideoTool.m
//  YueshengToutiao
//
//  Created by yellow on 2021/4/21.
//  Copyright © 2021 YW. All rights reserved.
//

#import "YWLittleVideoTool.h"

@implementation YWLittleVideoTool
+ (void)getVideoListStatusesWithParameters:(YWGetNewsListParam *)param success:(void(^)(YWGetNewsListStatus *status))success failure:(void(^)(NSError *error))failure{
    
    
    NSString *url = [NSString stringWithFormat:@"%@/api/UserInfo/GetNewsVedioByPage",domainURL];
    
    
    [YWHttpTool Post:url parameters:param.keyValues success:^(id responseObject) {
        
        //        YWLog(@"%@",responseObject);
                
                NSMutableDictionary *dictionary = (NSMutableDictionary *)responseObject;

                id ResultObj = dictionary[@"ResultObj"];

                if ([ResultObj isKindOfClass:[NSNull class]]) {

                    [dictionary setObject:[NSDictionary dictionary] forKey:@"ResultObj"];
                }
      
        YWGetNewsListStatus *status = [YWGetNewsListStatus objectWithKeyValues:responseObject] ;
        
        
        // 传递了block
        if (success) {
            success(status);
        }
        
    } failure:^(NSError *error) {
        
        if (failure) {
            failure(error);
        }
        
    }];
    
    
}

@end
